<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: Decider80211 Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00071.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">Decider80211 Class Reference<div class="ingroups"><a class="el" href="a00512.html">decider - decider modules</a> &#124; <a class="el" href="a00522.html">IEEE 802.11 - Classes for the IEEE 802.11 implementation of MiXiM</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Decider80211" --><!-- doxytag: inherits="BaseDecider" -->
<p><a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> for the 802.11 modules.  
 <a href="a00071.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00456_source.html">Decider80211.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Decider80211:</div>
<div class="dyncontent">
<div class="center"><img src="a00694.png" border="0" usemap="#Decider80211_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for Decider80211:</div>
<div class="dyncontent">
<div class="center"><img src="a00695.png" border="0" usemap="#Decider80211_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00696.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4ae">Decider80211ControlKinds</a> { <b>NOTHING</b> =  22100, 
<a class="el" href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4aeae5c2edad30720b7e527373b28bd4e1ab">COLLISION</a>, 
<a class="el" href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4aea397fbae93de43832a0bb2bc1bf7003a5">LAST_DECIDER_80211_CONTROL_KIND</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Control message kinds used by this <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a>.  <a href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4ae">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01af5857e545463912b90aa029a77363"></a><!-- doxytag: member="Decider80211::Decider80211" ref="a01af5857e545463912b90aa029a77363" args="(DeciderToPhyInterface *phy, double sensitivity, int myIndex, bool debug)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a01af5857e545463912b90aa029a77363">Decider80211</a> (<a class="el" href="a00079.html">DeciderToPhyInterface</a> *<a class="el" href="a00070.html#ac0f72556cb799d883b4219cab58320bb">phy</a>, double <a class="el" href="a00020.html#a5eece8bf532f92912ccbd0a3bc4d6fb0">sensitivity</a>, int <a class="el" href="a00020.html#a33e7f02028e78116193d09d6cdbc987e">myIndex</a>, bool <a class="el" href="a00020.html#aa22cd5156240713e37578172ba5557ce">debug</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Standard <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a64888f8d99455e640d22cdcdeae09a98">initFromMap</a> (const <a class="el" href="a00070.html#a7f3ee545f2ae8b0d8d1814c98917f5b6">ParameterMap</a> &amp;params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the decider from XML map data.  <a href="#a64888f8d99455e640d22cdcdeae09a98"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a59da14e36530b3a420e960a2d517e5df"></a><!-- doxytag: member="Decider80211::getLowerBandFrequency" ref="a59da14e36530b3a420e960a2d517e5df" args="(simtime_t_cref pTimePoint) const " -->
virtual <a class="el" href="a00013.html">Argument</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a59da14e36530b3a420e960a2d517e5df">getLowerBandFrequency</a> (simtime_t_cref pTimePoint) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The lower band frequency at given time point. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acdb12f5675ea4208432cc56aab3f2aec"></a><!-- doxytag: member="Decider80211::getUpperBandFrequency" ref="acdb12f5675ea4208432cc56aab3f2aec" args="(simtime_t_cref pTimePoint) const " -->
virtual <a class="el" href="a00013.html">Argument</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#acdb12f5675ea4208432cc56aab3f2aec">getUpperBandFrequency</a> (simtime_t_cref pTimePoint) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The upper band frequency at given time point. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00075.html">DeciderResult</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#ae8d8435cae6ef92cc9bf8008e0bb56e4">createResult</a> (const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the passed completed AirFrame was received correctly.  <a href="#ae8d8435cae6ef92cc9bf8008e0bb56e4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81e91e9aa6db0ebad8d19ae8b3bc037a"></a><!-- doxytag: member="Decider80211::getFrameReceivingPower" ref="a81e91e9aa6db0ebad8d19ae8b3bc037a" args="(airframe_ptr_t frame) const " -->
virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a81e91e9aa6db0ebad8d19ae8b3bc037a">getFrameReceivingPower</a> (<a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the receive power of given frame. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf38efc5fc1fe80116c5294ada09c97d"></a><!-- doxytag: member="Decider80211::packetOk" ref="abf38efc5fc1fe80116c5294ada09c97d" args="(double snirMin, int lengthMPDU, double bitrate) const " -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#abf38efc5fc1fe80116c5294ada09c97d">packetOk</a> (double snirMin, int lengthMPDU, double bitrate) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">computes if packet is ok or has errors <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00020.html#a5f79c1bbb4b39c82164e0805e1eeb699">channel_sense_rssi_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a0be01ad3cb9198b895cc7a0424a26609">calcChannelSenseRSSI</a> (simtime_t_cref start, simtime_t_cref end) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the RSSI value for the passed interval.  <a href="#a0be01ad3cb9198b895cc7a0424a26609"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a252eace2ccbe59484cd209be494a3983"></a><!-- doxytag: member="Decider80211::snrThreshold" ref="a252eace2ccbe59484cd209be494a3983" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a252eace2ccbe59484cd209be494a3983">snrThreshold</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">threshold value for checking a SNR-map (SNR-threshold) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15af6d061ab83d73474b6b94684707b6"></a><!-- doxytag: member="Decider80211::centerFrequency" ref="a15af6d061ab83d73474b6b94684707b6" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00071.html#a15af6d061ab83d73474b6b94684707b6">centerFrequency</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The center frequency on which the decider listens for signals. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> for the 802.11 modules. </p>
<p>Depending on the minimum of the snr included in the PhySDU this module computes a bit error probability. The header (1 Mbit/s) is always modulated with DBQPSK. The PDU is normally modulated either with DBPSK (1 and 2 Mbit/s) or CCK (5.5 and 11 Mbit/s). CCK is not easy to model, therefore it is modeled as DQPSK with a 16-QAM for 5.5 Mbit/s and a 256-QAM for 11 Mbit/s.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Marc L�bbers, David Raguin, Karl Wessel(port for MiXiM) </dd></dl>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="aadf94ce46e3edca3fa4d93150f72f4ae"></a><!-- doxytag: member="Decider80211::Decider80211ControlKinds" ref="aadf94ce46e3edca3fa4d93150f72f4ae" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4ae">Decider80211::Decider80211ControlKinds</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Control message kinds used by this <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a>. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="aadf94ce46e3edca3fa4d93150f72f4aeae5c2edad30720b7e527373b28bd4e1ab"></a><!-- doxytag: member="COLLISION" ref="aadf94ce46e3edca3fa4d93150f72f4aeae5c2edad30720b7e527373b28bd4e1ab" args="" -->COLLISION</em>&nbsp;</td><td>
<p><a class="el" href="a00168.html" title="Class that keeps track of the number of packets sent.">Packet</a> lost due to collision. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aadf94ce46e3edca3fa4d93150f72f4aea397fbae93de43832a0bb2bc1bf7003a5"></a><!-- doxytag: member="LAST_DECIDER_80211_CONTROL_KIND" ref="aadf94ce46e3edca3fa4d93150f72f4aea397fbae93de43832a0bb2bc1bf7003a5" args="" -->LAST_DECIDER_80211_CONTROL_KIND</em>&nbsp;</td><td>
<p>Sub-classing deciders should begin their own kinds at this value. </p>
</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><pre class="fragment">                                {
    NOTHING = 22100,
    <a class="code" href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4aeae5c2edad30720b7e527373b28bd4e1ab" title="Packet lost due to collision.">COLLISION</a>,
    <a class="code" href="a00071.html#aadf94ce46e3edca3fa4d93150f72f4aea397fbae93de43832a0bb2bc1bf7003a5" title="Sub-classing deciders should begin their own kinds at this value.">LAST_DECIDER_80211_CONTROL_KIND</a>
  };
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0be01ad3cb9198b895cc7a0424a26609"></a><!-- doxytag: member="Decider80211::calcChannelSenseRSSI" ref="a0be01ad3cb9198b895cc7a0424a26609" args="(simtime_t_cref start, simtime_t_cref end) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00020.html#a5f79c1bbb4b39c82164e0805e1eeb699">BaseDecider::channel_sense_rssi_t</a> Decider80211::calcChannelSenseRSSI </td>
          <td>(</td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>end</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calculates the RSSI value for the passed interval. </p>
<p>This method is called by <a class="el" href="a00020.html" title="Provides some base functionality for most common deciders.">BaseDecider</a> when it answers a ChannelSenseRequest or calculates the current channel state.</p>
<p>Returns the maximum RSSI value inside the passed time interval and the channel the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> currently listens to. The second value is the maximum reception end of all air frames in passed time interval. </p>

<p>Reimplemented from <a class="el" href="a00020.html#ac7a2b437d463db0f1f8f85d5a9685c2c">BaseDecider</a>.</p>

<p>References <a class="el" href="a00020.html#a53eb943cea4604171a5c1cc4cdec4c20">BaseDecider::calculateRSSIMapping()</a>, <a class="el" href="a00138.html#afbe1a1e1d2becd66d2c0d5a8ac42b478">MappingUtils::findMax()</a>, <a class="el" href="a00071.html#a59da14e36530b3a420e960a2d517e5df">getLowerBandFrequency()</a>, <a class="el" href="a00071.html#acdb12f5675ea4208432cc56aab3f2aec">getUpperBandFrequency()</a>, and <a class="el" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4">Argument::MappedZero</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                                                 {
    <a class="code" href="a00020.html#aa11a3ec12ab83f9223d7bf11279e6226" title="Return type of BaseDecider::calculateRSSIMapping function.">rssi_mapping_t</a> pairMapMaxEnd = <a class="code" href="a00020.html#a53eb943cea4604171a5c1cc4cdec4c20" title="Calculates a RSSI-Mapping (or Noise-Strength-Mapping) for a Signal.">calculateRSSIMapping</a>(start, end);
  <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a>       argMin(<a class="code" href="a00071.html#a59da14e36530b3a420e960a2d517e5df" title="The lower band frequency at given time point.">getLowerBandFrequency</a>(start));
  <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a>       argMax(<a class="code" href="a00071.html#acdb12f5675ea4208432cc56aab3f2aec" title="The upper band frequency at given time point.">getUpperBandFrequency</a>(end));

  Mapping::argument_value_t rssi = <a class="code" href="a00138.html#afbe1a1e1d2becd66d2c0d5a8ac42b478" title="Iterates over the passed mapping and returns value at the key entry with the highest value...">MappingUtils::findMax</a>(*pairMapMaxEnd.first, argMin, argMax, <a class="code" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4" title="Zero value of a Argument value.">Argument::MappedZero</a> <span class="comment">/* the value if no maximum will be found */</span>);

  <span class="keyword">delete</span> pairMapMaxEnd.first;
  <span class="keywordflow">return</span> std::make_pair(rssi, pairMapMaxEnd.second);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ae8d8435cae6ef92cc9bf8008e0bb56e4"></a><!-- doxytag: member="Decider80211::createResult" ref="ae8d8435cae6ef92cc9bf8008e0bb56e4" args="(const airframe_ptr_t frame) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00075.html">DeciderResult</a> * Decider80211::createResult </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a>&#160;</td>
          <td class="paramname"><em>frame</em></td><td>)</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if the passed completed AirFrame was received correctly. </p>
<p>Returns the result as a <a class="el" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a></p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The result of the decider for the passed AirFrame. </dd></dl>

<p>Reimplemented from <a class="el" href="a00020.html#ac6ef3a4cf1b91bcec788b540d61bfeba">BaseDecider</a>.</p>

<p>Reimplemented in <a class="el" href="a00073.html#a43d8e040f2971e4793878b19ca614d0f">Decider80211MultiChannel</a>.</p>

<p>References <a class="el" href="a00020.html#aea9e98c3a9752bcf08e42742b01d2fe3">BaseDecider::calculateSnrMapping()</a>, <a class="el" href="a00136.html#acdf62aed4b8a469e63c036e75567c2e3">Mapping::createConstIterator()</a>, <a class="el" href="a00138.html#a5d9c4e3dcaddccfa65f21212d0fee2cf">MappingUtils::findMin()</a>, <a class="el" href="a00192.html#afcfa26a0f384f475a019446b33c7458d">Signal::getBitrate()</a>, <a class="el" href="a00071.html#a59da14e36530b3a420e960a2d517e5df">getLowerBandFrequency()</a>, <a class="el" href="a00192.html#a2875223239e124d85949e1116cc12ae9">Signal::getReceptionEnd()</a>, <a class="el" href="a00192.html#a7c4710243cf87caf7dfc9f313e2619b2">Signal::getReceptionStart()</a>, <a class="el" href="a00071.html#acdb12f5675ea4208432cc56aab3f2aec">getUpperBandFrequency()</a>, <a class="el" href="a00059.html#ad4419c259e747867f003d07d62d4259f">ConstMappingIterator::getValue()</a>, <a class="el" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4">Argument::MappedZero</a>, <a class="el" href="a00059.html#afdafa6870cd19b3d35674a7bc777585d">ConstMappingIterator::next()</a>, <a class="el" href="a00071.html#abf38efc5fc1fe80116c5294ada09c97d">packetOk()</a>, and <a class="el" href="a00071.html#a252eace2ccbe59484cd209be494a3983">snrThreshold</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="comment">// check if the snrMapping is above the Decider&#39;s specific threshold,</span>
  <span class="comment">// i.e. the Decider has received it correctly</span>

  <span class="comment">// first collect all necessary information</span>
  <a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* snrMap = <a class="code" href="a00020.html#aea9e98c3a9752bcf08e42742b01d2fe3" title="Calculates a SNR-Mapping for a Signal.">calculateSnrMapping</a>(frame);
  assert(snrMap);

  <span class="keyword">const</span> <a class="code" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>&amp; s     = frame-&gt;getSignal();
  simtime_t     start = s.<a class="code" href="a00192.html#a7c4710243cf87caf7dfc9f313e2619b2" title="Returns the point in time when the receiving of the Signal started at the receiver module...">getReceptionStart</a>();
  simtime_t     end   = s.<a class="code" href="a00192.html#a2875223239e124d85949e1116cc12ae9" title="Returns the point in time when the receiving of the Signal ended at the receiver module. Already includes the propagation delay.">getReceptionEnd</a>();

  start = start + RED_PHY_HEADER_DURATION; <span class="comment">//its ok if the phy header is received only</span>
                       <span class="comment">//partly - TODO: maybe solve this nicer</span>

  <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> argMin(<a class="code" href="a00071.html#a59da14e36530b3a420e960a2d517e5df" title="The lower band frequency at given time point.">getLowerBandFrequency</a>(start));
  <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> argMax(<a class="code" href="a00071.html#acdb12f5675ea4208432cc56aab3f2aec" title="The upper band frequency at given time point.">getUpperBandFrequency</a>(end));

  Mapping::argument_value_t snirMin = <a class="code" href="a00138.html#a5d9c4e3dcaddccfa65f21212d0fee2cf" title="Iterates over the passed mapping and returns value at the key entry with the smallest value...">MappingUtils::findMin</a>(*snrMap, argMin, argMax, <a class="code" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4" title="Zero value of a Argument value.">Argument::MappedZero</a> <span class="comment">/* the value if no minimum will be found */</span>);

  deciderEV &lt;&lt; <span class="stringliteral">&quot; snrMin: &quot;</span> &lt;&lt; snirMin &lt;&lt; endl;

  <a class="code" href="a00059.html" title="Defines an const iterator for a ConstMapping which is able to iterate over the Mapping.">ConstMappingIterator</a>* bitrateIt = s.<a class="code" href="a00192.html#afcfa26a0f384f475a019446b33c7458d" title="Returns the function representing the bitrate of the signal.">getBitrate</a>()-&gt;<a class="code" href="a00136.html#acdf62aed4b8a469e63c036e75567c2e3" title="Returns an ConstMappingIterator by use of the respective implementation of the &quot;createIterator()&quot;-met...">createConstIterator</a>();
  bitrateIt-&gt;<a class="code" href="a00059.html#afdafa6870cd19b3d35674a7bc777585d" title="Iterates to the next position of the Mapping.">next</a>(); <span class="comment">//iterate to payload bitrate indicator</span>
  <span class="keywordtype">double</span> payloadBitrate = bitrateIt-&gt;<a class="code" href="a00059.html#ad4419c259e747867f003d07d62d4259f" title="Returns the value of the Mapping at the current position.">getValue</a>();
  <span class="keyword">delete</span> bitrateIt;

  <a class="code" href="a00076.html" title="Defines an extended DeciderResult for the 80211 protocol which stores the bit-rate of the transmissio...">DeciderResult80211</a>* result = NULL;

  <span class="keywordflow">if</span> (snirMin &gt; <a class="code" href="a00071.html#a252eace2ccbe59484cd209be494a3983" title="threshold value for checking a SNR-map (SNR-threshold)">snrThreshold</a>) {
    <span class="keywordflow">if</span>(<a class="code" href="a00071.html#abf38efc5fc1fe80116c5294ada09c97d" title="computes if packet is ok or has errors">packetOk</a>(snirMin, frame-&gt;getBitLength() - (int)PHY_HEADER_LENGTH, payloadBitrate)) {
      result = <span class="keyword">new</span> <a class="code" href="a00076.html" title="Defines an extended DeciderResult for the 80211 protocol which stores the bit-rate of the transmissio...">DeciderResult80211</a>(!frame-&gt;hasBitError(), payloadBitrate, snirMin);
    } <span class="keywordflow">else</span> {
      deciderEV &lt;&lt; <span class="stringliteral">&quot;Packet has BIT ERRORS! It is lost!\n&quot;</span>;
      result = <span class="keyword">new</span> <a class="code" href="a00076.html" title="Defines an extended DeciderResult for the 80211 protocol which stores the bit-rate of the transmissio...">DeciderResult80211</a>(<span class="keyword">false</span>, payloadBitrate, snirMin);
    }
  } <span class="keywordflow">else</span> {
    deciderEV &lt;&lt; <span class="stringliteral">&quot;Packet has ERRORS! It is lost!\n&quot;</span>;
    result = <span class="keyword">new</span> <a class="code" href="a00076.html" title="Defines an extended DeciderResult for the 80211 protocol which stores the bit-rate of the transmissio...">DeciderResult80211</a>(<span class="keyword">false</span>, payloadBitrate, snirMin);
  }

  <span class="keyword">delete</span> snrMap;
  snrMap = 0;

  <span class="keywordflow">return</span> result;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a64888f8d99455e640d22cdcdeae09a98"></a><!-- doxytag: member="Decider80211::initFromMap" ref="a64888f8d99455e640d22cdcdeae09a98" args="(const ParameterMap &amp;params)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Decider80211::initFromMap </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00070.html#a7f3ee545f2ae8b0d8d1814c98917f5b6">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the decider from XML map data. </p>
<p>This method should be defined for generic decider initialization.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>The parameter map which was filled by XML reader.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the initialization was successfully. </dd></dl>

<p>Reimplemented from <a class="el" href="a00070.html#ae19a201633e5b2bf2d545921049b4f26">Decider</a>.</p>

<p>Reimplemented in <a class="el" href="a00072.html#a0326c17f4fcbd636d61d0bafc314bb84">Decider80211Battery</a>.</p>

<p>References <a class="el" href="a00071.html#a252eace2ccbe59484cd209be494a3983">snrThreshold</a>.</p>
<div class="fragment"><pre class="fragment">                                                         {
    ParameterMap::const_iterator it           = params.find(<span class="stringliteral">&quot;threshold&quot;</span>);
    <span class="keywordtype">bool</span>                         bInitSuccess = <span class="keyword">true</span>;
    <span class="keywordflow">if</span>(it != params.end()) {
        <a class="code" href="a00071.html#a252eace2ccbe59484cd209be494a3983" title="threshold value for checking a SNR-map (SNR-threshold)">snrThreshold</a> = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No threshold defined in config.xml for Decider80211!&quot;</span>);
    }
    <span class="keywordflow">return</span> <a class="code" href="a00071.html#a64888f8d99455e640d22cdcdeae09a98" title="Initialize the decider from XML map data.">BaseDecider::initFromMap</a>(params) &amp;&amp; bInitSuccess;
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/<a class="el" href="a00456_source.html">Decider80211.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/Decider80211.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00071.html">Decider80211</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
